package com.zaofan.dao;

import com.zaofan.bean.AccountFromCount;
import com.zaofan.constant.UrlConstant;
import com.zaofan.dao.base.DaoSupportImpl;
import com.zaofan.mobile.bean.Fans;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import java.sql.SQLException;

/**
 * Created by Administrator on 2016/10/28.
 */
public class AccountFromCountDao extends DaoSupportImpl<AccountFromCount> {

    public void addCount(String fromtype) {
        try {
            String sql = "update " + AccountFromCount.class.getSimpleName().toLowerCase() +
                    " set count = count+1  where fromtype = '" + fromtype + "'";
            System.err.println(sql);
            QueryRunner runner = new QueryRunner(getDataSource());
            runner.update(sql);
        } catch (SQLException e) {
            e.printStackTrace();
        }

    }


}
